package com.wyg.blog.service.blog;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wyg.blog.model.blog.Blog;

import java.util.List;
import java.util.Map;

public interface BlogService {

    IPage<Blog> selectSomeBlogs(Page<?> page, String username);

    IPage<Blog> selectBolgByLike(Page<?> page, String username, String blog);

    List<Blog> selectLatestBlog();

    Integer selectBlogCount(Integer type_id);

    Integer selectAllBlogsCount();

    IPage<Blog> selectPublishedBlog(Page<?> page, boolean published, String username);

    IPage<Blog> selectAllBlogs(Page<?> page);

    Blog selectBlogById(Integer id);

    IPage<Blog> selectBlogByTypeId(Page<?> page, Integer type_id);

    IPage<Blog> selectBlogByTagId(Page<?> page, Integer tag_id);

    String selectTitleById(Integer id);

    Integer insertBlog(Blog blog);

    boolean renewBlog(Integer id, String title, Integer type_id, String description, String content);

    boolean renewViews(Integer id);

    boolean renewLikes(Integer id);

    boolean publishBlog(Integer id);

    boolean lockBlog(Integer id);

    boolean removeBlog(Integer id);

    String selectContent(Integer id);

    boolean insertContent(Integer id, String content);

    boolean renewContent(Integer id, String content);

    IPage<Map<String, String>> selectBlogInfo(Page<?> page);
}
